<!DOCTYPE html>
<html>
<head>
    <title>课程管理</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">


    <script src="/statics/plugins/select/vue-select.js"></script>

    <link rel="stylesheet" href="/statics/plugins/element-ui/index.css">
    <link rel="stylesheet" href="/statics/css/jquery.fileupload.css">
    <link rel="stylesheet" href="/statics/css/jquery.fileupload-ui.css">
    <link rel="stylesheet" href="/statics/css/bootstrap.min.css">
    <link rel="stylesheet" href="/statics/css/font-awesome.min.css">
    <link rel="stylesheet" href="/statics/plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="/statics/plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="/statics/css/main.css">
    <script src="/statics/libs/jquery.min.js"></script>
    <script src="/statics/plugins/layer/layer.js"></script>
    <script src="/statics/libs/bootstrap.min.js"></script>
    <script src="/statics/libs/vue.min.js"></script>
    <script src="/statics/libs/validator.min.js"></script>
    <script src="/statics/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="/statics/plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="/statics/plugins/ztree/jquery.ztree.all.min.js"></script>
    <!--add validationEngine start 前端验证-->
    <link rel="stylesheet" href="/statics/plugins/validationEngine/validationEngine.jquery.css">
    <script src="/statics/plugins/validationEngine/jquery.validationEngine-zh_CN.js"></script>
    <script src="/statics/plugins/validationEngine/jquery.validationEngine-custom.js"></script>
    <script src="/statics/plugins/validationEngine/jquery.validationEngine.js"></script>
    <!--add validationEngine end-->
    <script src="/statics/js/init.js"></script><script src="/statics/js/common.js"></script>

    <script src="/statics/libs/jfu/jquery.ui.widget.js"></script>
    <script src="/statics/libs/jfu/jquery.iframe-transport.js"></script>
    <script src="/statics/libs/jfu/jquery.fileupload.js"></script>


   <!-- <script src="https://unpkg.com/vue-select@2.0.0/dist/vue-select.js"></script>-->
    <script src="/statics/plugins/element-ui/index.js"></script>

    <style>
       /* @import url("//unpkg.com/element-ui@2.4.7/lib/theme-chalk/index.css");*/
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .avatar-uploader .el-upload:hover {
            border-color: #409EFF;
        }
        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 178px;
            height: 178px;
            line-height: 178px;
            text-align: center;
        }
        .avatar {
            width: 178px;
            height: 178px;
            display: block;
        }
        .ui-jqgrid tr.jqgrow td { text-overflow : ellipsis; }
        .el-input__inner {}
      /*  input[type=file]{display:none;}*/
       .edui-container *{-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}
       .edui-container *:before,.edui-container *:after {-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}
    </style>
    <style id="jsbin-css">
        #value {
            margin-top: 100px
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.content" @keyup.enter="query" placeholder="内容搜索">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <a v-if="hasPermission('orth:course:save')" class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            <a v-if="hasPermission('orth:course:update')" class="btn btn-primary" @click="update"><i
                    class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            <a v-if="hasPermission('orth:course:delete')" class="btn btn-primary" @click="del"><i
                    class="fa fa-trash-o"></i>&nbsp;删除</a>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">





            <div class="form-group">
                <div class="col-sm-2 control-label">开始时间</div>
                <div class="col-sm-10">
                    <template>
                        <div class="block">
                            <el-date-picker v-model="course.startTime" class="" type="date" placeholder="选择日期">
                            </el-date-picker>
                        </div>
                    </template>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">结束时间</div>
                <div class="col-sm-10">
                    <template>
                        <div class="block">
                            <el-date-picker v-model="course.endTime" class="" type="date" placeholder="选择日期">
                            </el-date-picker>
                        </div>
                    </template>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">标题前缀</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control validate[required,minSize[1],maxSize[500]]" v-model="course.title" placeholder="标题前缀"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">标题</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control validate[required,minSize[1],maxSize[500]]" v-model="course.subtitle" placeholder="标题"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">课程时长</div>
                <label class="radio-inline">
                    <input type="radio" name="courseTime" value="半天" v-model="course.dayText"/> 半天
                </label>
                <label class="radio-inline">
                    <input type="radio" name="courseTime" value="全天" v-model="course.dayText"/> 全天
                </label>
            </div>
            <div class="form-group" @click="courseChanged">
                <div class="col-sm-2 control-label">课程类型</div>
                <label class="radio-inline">
                    <input type="radio" name="course" value="0" v-model="course.type"/> 课程预告
                </label>
                <label class="radio-inline">
                    <input type="radio" name="course" value="1" v-model="course.type"/> 课程回顾
                </label>
            </div>

            <div class="form-group" v-show="isShow">
                <div class="col-sm-2 control-label">选择课程预告</div>
                <div class="col-sm-10">
                    <select id="preview_select"  v-model="course.ygId" class="form-control">
                        <option v-for="item in preview_course" :value="item.id_">{{item.name}}</option>
                    </select>
                    <div slot="tip" class="el-upload__tip">注意: 如果没有可选项，表示所有的课程预告都已经有课程回顾，此时不可添加回顾课程</div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">地点</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control validate[required,minSize[0],maxSize[500]]" v-model="course.site" placeholder="上课地点"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">摘要</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control  validate[required,minSize[0],maxSize[500]]" v-model="course.digest" placeholder="摘要"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">课程讲师</div>
                <div class="col-sm-10" style="z-index: 1000">
                    <v-select :placeholder="placeholder"
                              multiple
                              :options="options"
                              label="name"
                              @input="selecte_expert"
                              :value.sync="expert_obj"
                              class=""></v-select><!--:value.sync="expert_obj"--> <!-- @input="selecte_expert"-->
                  <!--  <div id="value">{{experts}}</div>-->
                </div>

            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">课程图片</div>
                <div class="col-sm-10">

                    <el-upload
                            class="avatar-uploader"
                            :action="requestUrl"
                            :show-file-list="false"
                            :data="token"
                            :on-success="handleAvatarSuccess0"
                            :before-upload="handlePreview0"
                            accept="image/*">
                        <img v-if="picture" :src="picture" style="" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                        <div slot="tip" class="el-upload__tip">图片尺寸只能上传jpg/png文件，且不超过2Mb</div>
                    </el-upload>

                </div>
            </div>



            <div class="form-group">
                <div class="col-sm-2 control-label">内容</div>
                <div class="col-sm-10">
                    <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script></div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>




<script src="/statics/js/modules/orth/course.js"></script>


<link href="/statics/plugins/utf8-jsp/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">

<script type="text/javascript" charset="utf-8" src="/statics/plugins/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/statics/plugins/utf8-jsp/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="/statics/plugins/utf8-jsp/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

    var um = UE.getEditor('editor');
    um.addListener( 'blur', function( editor) {
        var me = this;
        var  range = me.selection.getRange();
        var img = range.getClosedNode();
        if (img && img.tagName == 'IMG') {
            range.setStartAfter(img).setCursor(false, true);
        }
    });
</script>

<!--<script type="text/javascript">


    var um = UM.getEditor('editor', {
        toolbar:[
            'undo redo | bold italic  | superscript subscript | forecolor backcolor | removeformat |',
            'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize ' ,
            '| justifyleft justifycenter justifyright justifyjustify | link unlink | image ',
            '| horizontal print preview fullscreen'
        ],
        allHtmlEnabled: false,//提交到后台的数据是否包含整个html字符串
        autoHeightEnabled: false,
        autoFloatEnabled: false,
        allowDivTransToP: false//阻止div标签自动转换为p标签
    });


</script>-->
</body>
</html>